package com.wdfu.controller;

import com.wdfu.producer.KafkaProducerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wangdingfu
 * @Description:
 * @date 2020/5/4下午7:11
 */
@RestController
@RequestMapping("producer")
public class ProducerController {

    @Resource
    private KafkaProducerService kafkaProducerService;

    @GetMapping("send")
    public String sendMsg(@RequestParam String topic, @RequestParam String message) {
        kafkaProducerService.sendMsg(topic,message);
        return "<h1>send successful</h1>";
    }
}
